﻿/********************************************************************************/
// <copyright file="ApplicationConfigFactory.cs" company="Asia E-Business Solutions">
//     Copyright © 2012. All right reserved
// </copyright>
//
// <history>
//  <change who="Hieu Nguyen" date="17/12/2012 3:38:59 PM">Created</change>
// <history>
/********************************************************************************/

namespace JLL.China.Infrastructure.Repositories.ApplicationConfig
{

    using System.Collections.Generic;
    using LINQ = JLL.China.Infrastructure.Repositories.LINQ2SQL;

    public static class ApplicationConfigFactory
    {
     
        public static Model.ApplicationConfig FromLINQObject(LINQ.ApplicationConfig config)
        {
            if (config == null)
            {
                return null;
            }
            else
            {
                return new Model.ApplicationConfig
                {
                    Key = config.Key,
                    SettingValue = config.SettingValue,
                    ID = config.ID
                };

            }
        }

        public static LINQ.ApplicationConfig ToLINQObject(Model.ApplicationConfig config)
        {
            if (config == null)
            {
                return null;
            }
            else
            {
                return new LINQ.ApplicationConfig
                {
                    Key = config.Key,
                    SettingValue = config.SettingValue,
                    ID = config.ID
                };
            }
        }
    }
}
